//
//  Recent.h
//  SportSocial
//
//  Created by yull on 14/11/19.
//  Copyright (c) 2014年 yull. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PrivateChatMsg.h"
#import "GroupChatMsg.h"

#import <FMResultSet.h>

typedef NS_ENUM(NSInteger, SexType) {
    SexTypeBoy,
    SexTypeGirl,
};

typedef NS_ENUM(NSInteger, ChatInfoType)
{
    ChatInfoTypePrivate,
    ChatInfoTypeGroup,
    ChatInfoTypeSystem,
};

@interface ChatInfo : NSObject

@property (nonatomic, assign) UInt64 dbId;

@property (nonatomic, assign) UInt64 privateId;

@property (nonatomic, assign) UInt64 groupId;

@property (nonatomic, copy) NSString *icon;

@property (nonatomic, copy) NSString *name;

@property (nonatomic, assign) SexType sex;

@property (nonatomic, copy) NSString *content;

@property (nonatomic, assign) NSTimeInterval time;

@property (nonatomic, assign) NSInteger unReadCount;

@property (nonatomic, copy) NSString *senderName;

@property (nonatomic, assign) ChatInfoType infoType;

+ (instancetype)chatInfoWithPrivateMsg:(PrivateChatMsg *)chatMsg;

+ (instancetype)chatInfoWithGroupMsg:(GroupChatMsg *)chatMsg;

+ (instancetype)chatInfoWithResultSet:(FMResultSet *)resultSet;

@end
